#include<bits/stdc++.h>
using namespace std;
#define int long long

int cnt[2005] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};

signed main() {
	for (int i = 10; i <= 2000; i++)
		cnt[i] = cnt[i / 10] + cnt[i % 10];

	int n;
	cin >> n;
	n -= 4;
	int ans = 0;
	for (int i = 0; i <= 1000; i++) {
		for (int j = 0; j <= 1000; j++) {
			if (cnt[i] + cnt[j] + cnt[i + j] == n)
				ans++;
//			cout << i << " " << j << " " << ans << endl;
		}
	}
	cout << ans;
	return 0;
}
